package com.example.paopao.consumer.memer.service.impl;

import com.example.paopao.consumer.memer.dao.cache.IReleaseCacheRepository;
import com.example.paopao.consumer.memer.dao.persist.repository.IReleaseDetailRepository;
import com.example.paopao.consumer.memer.pojo.dto.ReleaseAddNewDTO;
import com.example.paopao.consumer.memer.pojo.temp.ReleaseWorkTemp;
import com.example.paopao.consumer.memer.pojo.vo.IntegraRacheGetVO;
import com.example.paopao.consumer.memer.pojo.vo.TranDetailVO;
import com.example.paopao.consumer.memer.service.ReleaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReleaseServiceImpl implements ReleaseService {
    @Autowired
    private IReleaseCacheRepository repository;

    @Autowired
    private IReleaseDetailRepository detailRepository;


    @Override
    public int addNew(ReleaseWorkTemp releaseWorkTemp) {
        return detailRepository.addNewTrans(releaseWorkTemp);
    }

    @Override
    public List<TranDetailVO> getTranDetail() {
        if (repository.getReleaseDetail().isEmpty()) {
            Long aLong = repository.savaReleaseDetail(detailRepository.listReleaseDetail());
        }
        return repository.getReleaseDetail();
    }
}
